package com.anywhere.freightman.common.entity;


import com.anywhere.freightman.common.enumeration.StatusCode;

public class ReturnResp {
    private StatusCode code;
    private String message;
    private Object obj;

    public ReturnResp() {
    }

    public ReturnResp(StatusCode code, String message, Object obj) {
        this.code = code;
        this.message = message;
        this.obj = obj;
    }

    public static ReturnResp buildOk() {
        return new ReturnResp(StatusCode.SUCCESS, "ok", null);
    }

    public static ReturnResp buildOk(Object obj) {
        return new ReturnResp(StatusCode.SUCCESS, "ok", obj);
    }

    public static ReturnResp buildFail(String message) {
        return new ReturnResp(StatusCode.FAIL, message, null);
    }

    public StatusCode getCode() {
        return code;
    }

    public void setCode(StatusCode code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getObj() {
        return obj;
    }

    public void setObj(Object obj) {
        this.obj = obj;
    }
}
